package com.pzl.controller;

import com.pzl.entity.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.xml.ws.RequestWrapper;
import java.io.IOException;

/**
 * Created by panzhenglei on 2019/6/4.
 */


@org.springframework.stereotype.Controller
//@RequestMapping("/user")
public class Controller {

    @RequestMapping("/save1")
    public String save1() {

        System.out.println("Controller save running...");

        return "success";
    }

    @RequestMapping("/save2")
    @ResponseBody
    public String save2() {
        System.out.println("Controller save2 running...");
        return "success";
    }

    @RequestMapping("/save3")
    @ResponseBody
    public User save3 ()throws IOException {
        System.out.println("Controller save3 running...");
        User user = new User();
        user.setName("zhangsan");
        user.setGender(1);
        return user;
    }

}
